package _5;

public class _1_Student {
	public enum SPECIALITY {
		AVIATION, BIOLOGY, GEOGRAPHY, GEOLOGY, PSYCHOLOGY
	}

	public enum UNIVERSITY {
		SU, TU, UNSS
	}

	private static int nInstances = 0;
	private int course;
	private String fullName;
	private SPECIALITY speciality;
	private UNIVERSITY university;

	public static int getNInstances () {
		return _1_Student.nInstances;
	}

	public static void main (String[] args) {
		_1_Student yordan = new _1_Student ();
		yordan.setCourse (3);
		yordan.setName ("Yordan");
		yordan.setSpeciality (_1_Student.SPECIALITY.PSYCHOLOGY);
		yordan.setUniversity (_1_Student.UNIVERSITY.SU);
		yordan.print ();

		_1_Student julian = new _1_Student (1, "Julian",
				_1_Student.SPECIALITY.AVIATION, _1_Student.UNIVERSITY.TU);
		julian.print ();

		_1_Student peter = new _1_Student (3, "Peter",
				_1_Student.SPECIALITY.PSYCHOLOGY, _1_Student.UNIVERSITY.SU);
		peter.print ();

		System.out.println ("Total number of students: "
				+ _1_Student.getNInstances ());
	}
	
	public _1_Student () {
		_1_Student.nInstances++;
		this.course = 0;
		this.fullName = "";
		this.speciality = null;
		this.university = null;
	}

	public _1_Student (int course, String fullName, SPECIALITY speciality,
			UNIVERSITY university) {
		_1_Student.nInstances++;
		this.course = course;
		this.fullName = fullName;
		this.speciality = speciality;
		this.university = university;
	}

	public int getCoruse () {
		return this.course;
	}

	public String getName () {
		return this.fullName;
	}

	public String getSpeciality () {
		return this.speciality.name ();
	}

	public String getUniversity () {
		return this.university.name ();
	}

	public void print () {
		System.out.println ("Student: " + this.fullName);
		System.out.println ("course: " + this.course);
		System.out.println ("Speciality: " + speciality.toString ());
		System.out.println ("University: " + university.toString ());
		System.out.println ();
	}

	public void setCourse (int course) {
		this.course = course;
	}

	public void setName (String name) {
		this.fullName = name;
	}

	public void setSpeciality (_1_Student.SPECIALITY s) {
		this.speciality = s;
	}

	public void setUniversity (_1_Student.UNIVERSITY u) {
		this.university = u;
	}
}
